<?xml version="1.0" encoding="UTF-8"?>
<!--

       Copyright 2006-2016 the original author or authors.

       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.

-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>The &lt;ignoreColumnsByRegex&gt; Element</title>
  <link rel="stylesheet" type="text/css" href="../mbgstyle.css" />
</head>
<body>
<h1>The &lt;ignoreColumnsByRegex&gt; Element</h1>
<p>The &lt;ignoreColumnsByRegex&gt; element is used to tell MyBatis Generator (MBG) to ignore a
set of columns in an introspected table - the set is determined by matching against a regular 
expression specified in this element.  No generated SQL will refer to the ignored columns, and no
properties will be generated for the ignored columns in the model objects.
This element is an optional child
element of the <a href="table.html">&lt;table&gt;</a> element.</p>
<p>You can specify exceptions to the pattern through use of an
<a href="except.html">&lt;except&gt;</a> element.</p>
<h2>Required Attributes</h2>
<table border="1" cellspacing="0" cellpadding="5">
  <tr>
    <th>Attribute</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>pattern</td>
    <td>The regular expression used to match column names.  The regular expression
        engine is the standard <code>java.util.regex.Pattern</code> engine.</td>
  </tr>
</table>

<h2>Optional Attributes</h2>
<p>None</p>

<h2>Child Elements</h2>
<ul>
  <li><a href="except.html">&lt;except&gt;</a> (0..N)</li>
</ul>

<h2>Example</h2>
<p>This example tells MyBatis to ignore every column in the Foo table that begins with
the characters "col" (case-insensitive) except for "col01" and "col13".</p>
<pre>
    &lt;table tableName="Foo"&gt;
      &lt;ignoreColumnsByRegex pattern="(?i)col.*"&gt;
        &lt;except column="col01"/&gt;
        &lt;except column="col13"/&gt;
      &lt;/ignoreColumnsByRegex&gt;
    &lt;/table&gt;
</pre>
</body>
</html>
